package com.zhai.boot.domain.in;

import com.zhai.boot.annotation.TrimField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * @author Created by 翟凤玺
 * @package com.zhai.boot.domain.in
 * @project-name zhai-boot
 * @description 测试trim注解
 * @create-datetime 2019-6-19 18:04
 */
@Data
public class TrimDataIn {

    @TrimField(regex = TrimField.SPACE)
    @NotBlank(message = "姓名不能为空")
    @Size(min = 2, max = 6, message = "姓名长度在2-6位")
    @ApiModelProperty(value = "姓名", example ="小翟", required = true)
    private String name;

    @TrimField(regex = TrimField.SINGLE_QUOTES)
    private String hobby;
}
